<?php

namespace App\Model\Guild;

use App\Model\Guild\GuildBase;

/**
 * 工会主播标签
 */
class GuildHostTag extends GuildBase
{
    protected $table = 'guild_host_tag';
    protected $fillable = [
        'flag', 'tag_name', 'guild_manage_id'
    ];

    public function guildHost()
    {
        return $this->hasMany(GuildHost::class, 'id', 'tag_id');
    }

    static function getTags($guildId = 0)
    {
        $data = [0 => ' '];
        $data = array_merge($data, self::where(['guild_manage_id' => $guildId])->pluck('tag_name', 'id')->toArray());
        return $data;
    }
}
